package com.eci.common.asset.kit;

import java.util.HashMap;

public class Maps extends HashMap<String, Object> {
 
	private static final long serialVersionUID = 1L;
	
	private Maps() {
		
	}
	
	public static Maps of(Object... args) {
		
		if(args.length%2 ==1) {
			throw new RuntimeException("the number of args must be even");
		}
		
		Maps map = new Maps();
		if(args.length == 0) {
			return map;
		}
		
		for(int i=0 ; i< args.length;i+=2) {
			map.put(String.valueOf(args[i]), args[i+1]);
		} 
		return map;
	}
	
	
	public Maps add(String k,Object v) {
		this.put(k, v);
		return this;
	}

}
